﻿@using Resource;
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="UTF-8">
    @{ await Html.RenderPartialAsync("/Views/Shared/_LayoutScript.cshtml"); }
    <title>@Error.Error404</title>
    <style>
        body {
            background-color: #f4f4f4;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        .container {
            text-align: center;
            padding: 20px;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .message {
            font-size: 24px;
            margin-bottom: 20px;
        }

        .countdown {
            font-size: 48px;
            font-weight: bold;
            margin-bottom: 20px;
        }

        .redirect {
            font-size: 18px;
        }

        .redirect a {
            color: #007bff;
            text-decoration: none;
        }

        .btn > a {
            display: inline-block;
            padding: 10px 20px;
            background-color: #007bff;
            color: #fff;
            text-decoration: none;
            border-radius: 5px;
            transition: background-color 0.3s ease;
        }

        .btn > a:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="message">@Error.Error404</div>
        <div class="countdown" id="countdown">3</div>
        <div class="redirect">@Error.GoTo <a></a></div>
        </br>
        <div class="btn"><a>@Error.ClickGoTo</a></div>
    </div>

    <script>
        $('.redirect a').text(url);
        $('a').attr('href', url);
        function countdown() {
            var countdownValue = parseInt($('#countdown').text());
            if (countdownValue > 0) {
                $('#countdown').text(countdownValue - 1);
                setTimeout(countdown, 1000);
            } else {
                window.location.href = url;
            }
        }

        $(window).on('load', function () {
            setTimeout(countdown, 1000);
        });

    </script>
</body>
</html>